/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.ipti.br.tag.util;

import java.util.logging.Level;
import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
 *
 * @author ipti
 */
public abstract class NonBeanInjection<T>{
    
    protected T getBean(String ejb){
        T obj = null;
        try {
            obj =  (T) new InitialContext().lookup("java:global/TAG2/"+ejb);
        } catch (NamingException ex) {
            LoggerUtil.log("getEJB", Level.SEVERE, "Não recuperou EJB", ex);
            ex.printStackTrace();
        }
        return obj;
    }
}
